package com.flitsneak.designpatterns.structuralpatterns.flyweight;

/**
 * @author flitsneak
 * @email flitsneak@gmail.com
 * @date 2022/7/14 17:50
 * @description
 */
public class ConcreteBackup implements Backup {

    private String otherRequest;

    ConcreteBackup(String otherRequest) {
        this.otherRequest = otherRequest;
        System.out.println(otherRequest + "的备胎被选中");
    }

    @Override
    public String pickBackup(BackupPrerequisites backupPrerequisites) {
        System.out.println("挑选的备胎条件是：" + backupPrerequisites.getTall() + backupPrerequisites.getRich() + backupPrerequisites.getHandsome() + otherRequest);
        return backupPrerequisites.getTall()+ backupPrerequisites.getRich() + backupPrerequisites.getHandsome() + otherRequest;
    }
}
